package com.springbootblog.dao;

import com.springbootblog.dao.sqlBuilder.ArticleSqlBuilder;
import com.springbootblog.dao.sqlBuilder.MessageSqlBuilder;
import com.springbootblog.dao.sqlBuilder.ToolsSqlBuilder;
import com.springbootblog.pojo.Message;

import java.util.List;

import com.springbootblog.pojo.User;
import org.apache.ibatis.annotations.*;

@Mapper
public interface MessageDao
{
    @SelectProvider(type = MessageSqlBuilder.class, method = "getUserInfoById")
    User getUserInfoById(@Param("id") String id);

    @SelectProvider(type = MessageSqlBuilder.class, method = "getMessageInfo")
    Message getMessageInfo(@Param("id") String id);

    @SelectProvider(type = MessageSqlBuilder.class, method = "getMessageList")
    List<Message> getMessageList();

    @SelectProvider(type = MessageSqlBuilder.class, method = "getMessageListTwo")
    List<Message> getMessageListTwo(@Param("id") String id);

    @SelectProvider(type = MessageSqlBuilder.class, method = "getMessageListTwoReply")
    Message getMessageListTwoReply(@Param("id") String id);

    @UpdateProvider(type = MessageSqlBuilder.class, method = "updateUserInfo")
    Integer updateUserInfo(@Param("id") String id, @Param("email") String email);

    @InsertProvider(type = MessageSqlBuilder.class, method = "addMessageData")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    Integer addMessageData(Message message);
}